#include<stdio.h>
   int main()
   {

       char ch[99];
       scanf("%s",ch);
       int count1=0,count2=0;
       for(int i=0;i<100;i++)
       {
        if(ch[i]==')')
       count1++;
        else if(ch[i]=='(')
        count2++;
         else
         continue;
}
      if(count1==count2)
        printf("parentheses match!\n");
      else
        printf("parentheses do not match!\n");

       return 0;
   }
